package models;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.LinkedHashSet;
import java.util.Set;

import javax.swing.DefaultListModel;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;

import objects.ActorObject;
import objects.CategoryObject;
import objects.EpisodeObject;
import objects.SeasonObject;
import objects.SerialContainer;
import objects.SerialObject;
import utils.SosUtils;

public class test1 extends JPanel {

	/**
	 * Create the panel.
	 */

	JTextField seasonText = new JTextField();
	JTextField episodeText = new JTextField();
	DefaultListModel seasonAddModel = new DefaultListModel();
	DefaultListModel epModel = new DefaultListModel();
	JList episodeJList = new JList();
	JList seasonJList = new JList();
	JTextField serialTitleField = new JTextField();
	JTextField serialOrigTitleField = new JTextField();
	JTextField yearStartField = new JTextField();
	JTextField yearEndField = new JTextField();
	int nextSerialId = 0;
	int nextSeasonId = 0;
	int nextEpisodeId = 0;
	int nextActorId = 0;
	SerialContainer serialContainer = new SerialContainer();
	Set<SerialObject> serialList = new LinkedHashSet<SerialObject>();
	Set<SeasonObject> seasonList = new LinkedHashSet<SeasonObject>();
	Set<EpisodeObject> episodeList = new LinkedHashSet<EpisodeObject>();
	Set<ActorObject> actorList = new LinkedHashSet<ActorObject>();
	Set<CategoryObject> catList = new LinkedHashSet<CategoryObject>();
	private JTextField uploadField;
	private JTextField genreField;

	public test1() {

		SosUtils utils = new SosUtils();
		JPanel mainthis = new JPanel();
		ImageIcon save = utils.createImageIcon("images/database_zoom_128.png");
		mainthis.setLayout(null);

		this.setBounds(0, 0, 1500, 771);
		mainthis.add(this);
		this.setLayout(null);

		JLabel lblSerienTitel = new JLabel("Serien Titel");
		lblSerienTitel.setBounds(10, 28, 65, 14);
		this.add(lblSerienTitel);
		serialTitleField.setBounds(117, 25, 239, 20);
		this.add(serialTitleField);
		serialTitleField.setColumns(10);

		JLabel lblOriginalTitel_1 = new JLabel("Original Titel");
		lblOriginalTitel_1.setBounds(10, 59, 65, 14);
		this.add(lblOriginalTitel_1);
		serialOrigTitleField.setBounds(117, 56, 239, 20);
		this.add(serialOrigTitleField);
		serialOrigTitleField.setColumns(10);

		JLabel lblStartJahr_1 = new JLabel("Start Jahr");
		lblStartJahr_1.setBounds(10, 90, 65, 14);
		this.add(lblStartJahr_1);
		yearStartField.setBounds(117, 87, 86, 20);
		this.add(yearStartField);
		yearStartField.setColumns(10);

		JLabel lblEndJahr = new JLabel("End Jahr");
		lblEndJahr.setBounds(10, 121, 46, 14);
		this.add(lblEndJahr);
		yearEndField.setBounds(117, 118, 86, 20);
		this.add(yearEndField);
		yearEndField.setColumns(10);

		JLabel lblBeschreibung_2 = new JLabel("Beschreibung");
		lblBeschreibung_2.setBounds(366, 28, 65, 14);
		this.add(lblBeschreibung_2);

		JTextArea serialDescArea = new JTextArea();
		serialDescArea.setBounds(450, 23, 234, 176);
		this.add(serialDescArea);

		JLabel lblStaffelHinzufgen = new JLabel("Staffel hinzuf\u00FCgen");
		lblStaffelHinzufgen.setBounds(10, 237, 95, 14);
		this.add(lblStaffelHinzufgen);
		seasonText.setBounds(117, 234, 239, 20);
		this.add(seasonText);
		seasonText.setColumns(10);
		seasonJList.setBounds(450, 236, 239, 117);
		this.add(seasonJList);

		JButton btnAddSeason = new JButton("Hinzuf\u00FCgen");
		btnAddSeason.setBounds(699, 233, 89, 23);
		this.add(btnAddSeason);

		JButton btnDeleteSeason = new JButton("Remove");
		btnDeleteSeason.setBounds(699, 267, 89, 23);
		this.add(btnDeleteSeason);

		JLabel lblEpisodeHinzufgen = new JLabel("Episode hinzuf\u00FCgen");
		lblEpisodeHinzufgen.setBounds(10, 391, 95, 14);
		this.add(lblEpisodeHinzufgen);
		episodeText.setBounds(117, 388, 239, 20);
		this.add(episodeText);
		episodeText.setColumns(10);
		episodeJList.setBounds(450, 390, 234, 149);
		this.add(episodeJList);

		JButton btnAddEpisode = new JButton("Hinzuf\u00FCgen");
		btnAddEpisode.setBounds(699, 387, 89, 23);
		this.add(btnAddEpisode);

		JButton btnRemoveEpisode = new JButton("Remove");
		btnRemoveEpisode.setBounds(699, 421, 89, 23);
		this.add(btnRemoveEpisode);

		JLabel lblSchauspieler_1 = new JLabel("Schauspieler");
		lblSchauspieler_1.setBounds(10, 575, 86, 14);
		this.add(lblSchauspieler_1);

		final JTextField actorText = new JTextField();
		actorText.setBounds(117, 572, 239, 20);
		this.add(actorText);
		actorText.setColumns(10);

		final JList actorJList = new JList();
		actorJList.setBounds(450, 574, 239, 145);
		this.add(actorJList);

		JLabel label = new JLabel("Beschreibung");
		label.setBounds(10, 608, 65, 14);
		this.add(label);

		JLabel label_1 = new JLabel("Beschreibung");
		label_1.setBounds(10, 425, 65, 14);
		this.add(label_1);

		JTextArea actorDescrArea = new JTextArea();
		actorDescrArea.setBounds(113, 603, 243, 124);
		this.add(actorDescrArea);

		JButton btnAddActor = new JButton("Hinzuf\u00FCgen");
		btnAddActor.setBounds(699, 575, 89, 23);
		this.add(btnAddActor);

		final DefaultListModel actModel = new DefaultListModel();

		btnAddActor.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});

		JButton btnRemoveActor = new JButton("Remove");
		btnRemoveActor.setBounds(699, 609, 89, 23);
		this.add(btnRemoveActor);

		btnRemoveActor.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});
		
		uploadField = new JTextField();
		uploadField.setBounds(117, 179, 239, 20);
		add(uploadField);
		uploadField.setColumns(10);
		
		JButton uploadBtn = new JButton("Upload");
		uploadBtn.setBounds(10, 178, 89, 23);
		add(uploadBtn);
		
		JLabel genreLabel = new JLabel("Genre");
		genreLabel.setBounds(10, 151, 46, 14);
		add(genreLabel);
		
		genreField = new JTextField();
		genreField.setBounds(117, 148, 239, 20);
		add(genreField);
		genreField.setColumns(10);
		
		JButton saveSerialBtn = new JButton("Serie speichern");
		saveSerialBtn.setBounds(503, 210, 136, 23);
		add(saveSerialBtn);
		
		JTextArea episodeDescArea = new JTextArea();
		episodeDescArea.setBounds(113, 420, 243, 124);
		add(episodeDescArea);
		
		JButton saveSeason = new JButton("Staffel speichern");
		saveSeason.setBounds(503, 364, 136, 23);
		add(saveSeason);
		
		JButton saveEpisodeBtn = new JButton("Episoden speichern");
		saveEpisodeBtn.setBounds(503, 550, 136, 23);
		add(saveEpisodeBtn);
		
		JButton saveActorBtn = new JButton("Actor speichern");
		saveActorBtn.setBounds(503, 720, 136, 23);
		add(saveActorBtn);

	}
}
